﻿<UserControl x:Class="Oxage.Windows.Controls.Console"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:c="clr-namespace:Oxage.Windows.Controls"
  mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600">
  <UserControl.DataContext>
    <c:ConsoleViewModel />
  </UserControl.DataContext>
  <UserControl.Resources>
    <Style x:Key="ConsoleTextBoxStyle" TargetType="TextBox">
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="BorderBrush" Value="Transparent" />
      <Setter Property="Background" Value="Transparent" />
      <Setter Property="Foreground" Value="White" />
      <Setter Property="FontFamily" Value="Consolas" /><!--Courier New-->
      <Setter Property="FontSize" Value="10pt"/>
      <Setter Property="Padding" Value="0"/>
    </Style>
  </UserControl.Resources>
  
  <Grid>
    <ScrollViewer x:Name="scroller" GotFocus="output_GotFocus" BorderThickness="0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
      <Grid Width="620" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" />
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBox x:Name="output" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" AcceptsReturn="True" Foreground="#FFFFFF" GotFocus="output_GotFocus" Style="{StaticResource ConsoleTextBoxStyle}" TextWrapping="Wrap" Visibility="{Binding OutputVisibility}" />
        <TextBox x:Name="prompt" Grid.Row="1" Grid.Column="0" Margin="0,-1,0,0" Foreground="#FFFFFF" GotFocus="output_GotFocus" Style="{StaticResource ConsoleTextBoxStyle}" Text="{Binding Prompt}" />
        <TextBox x:Name="input" Grid.Row="1" Grid.Column="1" Margin="-7.75,-1,0,0" KeyDown="input_KeyDown" Foreground="#FFFFFF" Style="{StaticResource ConsoleTextBoxStyle}" TextWrapping="Wrap" />
				<!-- Use CaretBrush="White" in WPF 4.0 -->
      </Grid>
    </ScrollViewer>
  </Grid>
  
</UserControl>
